Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ampd build job #258

Merged
merged 7 commits into from
Feb 16, 2024
Merged

feat: add ampd build job #258

merged 7 commits into from
Feb 16, 2024

Conversation

kalidax
Copy link
Contributor

@kalidax kalidax commented Feb 6, 2024

Description

  • Build multi architecture binaries for linux/macos for amd64/arm64 architectures
  • Build multi architecture docker image, today we only build for Linux amd64 but it can be extended very easily
  • Add Makefile to build docker images, for binaries, the way to build is not enough generic, it is probably not interesting to add a target by binary
  • (Not in the gh action) Create S3 folder to store ampd binaries and files associated

Todos

Update secrets

  • DOCKER_HUB_TOKEN
  • DOCKER_HUB_USERNAME
cd axelar-amplifier
gh secret set DOCKER_HUB_USERNAME -b"XXXX"
gh secret set DOCKER_HUB_TOKEN -b"XXXX"

Create secrets

cd axelar-amplifier
gh secret set GPG_PRIVATE_KEY -b"XXXX"
gh secret set GPG_PASSPHRASE  -b"XXXX"
gh secret set CICD_RSA_KEY -b"XXXX"

Steps to Test

  • Uncomment the commented parts
  • Uncomment gpg commands in "build and sign darwin binaries" and "build and sign linux binaries"
  • Run using workflow dispatch trigger

Expected Behaviour

  • Binaries are built, tagged, uploaded to release, uploaded to S3
  • Docker image is built, and pushed to dockerhub

Other Notes

Example of run in success
https://github.com/axelarnetwork/axelar-amplifier/actions/runs/7791445362
but we should validate with an end to end test with all parts uncommented

@kalidax kalidax requested a review from a team as a code owner February 6, 2024 11:18
@kalidax kalidax requested a review from talalashraf February 6, 2024 11:18
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1521676) 89.60% compared to head (7e59ada) 89.60%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #258   +/-   ##
=======================================
  Coverage   89.60%   89.60%           
=======================================
  Files         166      166           
  Lines       17170    17170           
=======================================
  Hits        15385    15385           
  Misses       1785     1785           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@talalashraf talalashraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tonnes of deprecation notices on the github action run here, since this is a fresh pipeline, lets clean up all the ones that can be cleaned, if a node 20 release is not available for a certain action we can ignore that for now but i think ideally there should be no warnings for deprecations etc.

https://github.com/axelarnetwork/axelar-amplifier/actions/runs/7791445362

.github/workflows/build-docker-image-and-binaries.yaml Outdated Show resolved Hide resolved
.github/workflows/build-docker-image-and-binaries.yaml Outdated Show resolved Hide resolved
.github/workflows/build-docker-image-and-binaries.yaml Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
.github/workflows/build-docker-image-and-binaries.yaml Outdated Show resolved Hide resolved
.github/workflows/build-docker-image-and-binaries.yaml Outdated Show resolved Hide resolved
@talalashraf
Copy link
Contributor

Added the secrets, you can test the pipeline.

@kalidax kalidax requested a review from a team as a code owner February 13, 2024 22:16
@kalidax kalidax force-pushed the feat/add-build-job branch 2 times, most recently from 56eb527 to 65e694c Compare February 15, 2024 14:18
@talalashraf talalashraf merged commit 360560d into main Feb 16, 2024
7 checks passed
@talalashraf talalashraf deleted the feat/add-build-job branch February 16, 2024 17:40
Comment on lines +68 to +70
mkdir ampdbin
mv "/Users/runner/work/axelar-amplifier/axelar-amplifier/target/aarch64-apple-darwin/release/ampd" "./ampdbin/ampd-$OS-$ARCH-$SEMVER"
gpg --armor --detach-sign "./ampdbin/ampd-$OS-$ARCH-$SEMVER"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lot of duplication here, ideally the OS specific vars/cmds are set/run separately first and then you can run the remaining cmds generically

E.g. In a prior step, define the rust target as a var, and install any deps if needed

OUTPUT=$(file "$binary" | cut -d: -f2- | awk -F, '{print $1"," $2}')
if [[ "${{ matrix.os }}" == "ubuntu-22.04" ]]; then
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
EXPECTED="ELF 64-bit LSB pie executable, x86-64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these can be set in the same step above where you're setting arch specific vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants